package ua.com.globallogic.training.main;

import com.sun.org.apache.xpath.internal.SourceTree;
import ua.com.globallogic.training.task1.FibonachiNumbers;
import ua.com.globallogic.training.task1.Mathematics;
import ua.com.globallogic.training.task2.Device;
import ua.com.globallogic.training.task2.PortableDevice;
import ua.com.globallogic.training.task2.Smartphone;

import java.util.*;

public class Runner {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
        Map<Integer, String> hashMap = new HashMap<Integer, String>();
        hashMap.put(1, "one");

        System.out.println(hashMap);
    }

    static void priorityQueueTest() {
        Queue<String> priorityQueue = new PriorityQueue<String>();
        priorityQueue.offer("one");
        priorityQueue.offer("second");
        priorityQueue.offer("3rd");
        priorityQueue.offer("second");

        System.out.println(priorityQueue);
    }

	static void testTask1() {
		FibonachiNumbers fibonachiRowThreeElements = new FibonachiNumbers(3);
		fibonachiRowThreeElements.printFibonachiRow();
		System.out.println("\n1st element of the fibonachi row: " + fibonachiRowThreeElements.getFibonachiRowElement(0));
		
		FibonachiNumbers fibonachiRowBig = new FibonachiNumbers(25);
		fibonachiRowBig.printFibonachiRow();
		System.out.println("\n25th element of the fibonachi row: " + fibonachiRowBig.getFibonachiRowElement(24));
		
		//Negative cases
		FibonachiNumbers fibonachiRowNegative = new FibonachiNumbers(-1);
		FibonachiNumbers fibonachiRowZeroElements = new FibonachiNumbers(0);
		FibonachiNumbers fibonachiRowSmallTwoElements = new FibonachiNumbers(2);

	}

	static void testTask2() {
		// using different constructors
		Device PC = new Device("O1H5836967E", "LG", 3300.5);
		Device genericDevice = new Device();
		PortableDevice tablet = new PortableDevice(6.0, true);
		Smartphone nexus = new Smartphone(2);

		// overloading
		genericDevice.turnOn();
		PC.turnOn("safe");
		tablet.turnOn(true);

		// overriding
		PC.printCharacteristics();
		tablet.printCharacteristics();
		nexus.printCharacteristics();
		
		// device.makeCall(); Calling method of children class from object of
		// parent class
		
	}
}